<?php
class CountriesController extends AppController {
    public $name    = 'Countries';
    public $helpers = array('Form');
    public $scaffold;

    public function listing () {
        $data = $this->Country->find('all', array(
            'recursive' => -1,
            'fields'    => array('Country.name'),
            'order'     => array('Country.name')
        ));

        $countries = array();

        foreach ($data as $i=>$c) {
            $countries[$i] = $c['Country']['name'];
        }

        $this->response($countries);
    } // listing

    function api () {
        Configure::write('debug', 0);
        $countries = $this->Country->find('all');
        $this->set(compact('countries'));
    } // api
} // CountriesController
?>